//------奖金测算 数据 机构考核结果--//------
import request from "@/router/axios";


export function fetchList(query) {
  return request({
    url: '/bonus/bonusdeptassess/page',
    method: 'get',
    params: query
  })
}

//新增
export function addObj(obj) {
  return request({
    url: '/bonus/bonusdeptassess',
    method: 'post',
    data: obj
  })
}

//编辑
export function putObj(obj) {
  return request({
    url: '/bonus/bonusdeptassess',
    method: 'put',
    data: obj
  })
}


export function delBatch(ids) {
  return request({
    url: '/bonus/bonusdeptassess/deleteBatch',
    method: 'get',
    params: ids
  })
}

export function getPeriodDic() {
  return request({
    url: '/appr-event/pfhzhzzq/getHzzq',
    method: 'get',
  })
}

//通过周期获取奖惩数据
export function getDataByPeriod(period,type) {
  let url = ''
  if (type == 'ry'){
    url = '/bonus/bonuspersonassess/getScoreOther/' ;
  }else{
    url = '/bonus/bonusdeptassess/getScoreOther/' ;
  }
  return request({
    url: url +period,
    method: 'get',
  })
}


export function saveAssementList(obj,type) {
  let url  = '' ;
  if (type == 'ry'){
    url = '/bonus/bonuspersonassess/batch' ;
  }else{
    url = '/bonus/bonusdeptassess/batch' ;
  }
  return request({
    url: url, //换接口
    method: 'post',
    data: obj
  })
}
